{include file="public/nheader"}
<style type="text/css">
    #lay-tableList {
        height: auto;
    }
</style>
<style type="text/css">
    .layui-table-view .layui-table[lay-size=lg] .layui-table-cell {
        height: auto;
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <select name="status" lay-verify="">
                                <option value="">开启关闭筛选</option>
                                <option value="1" {if !empty(input('get.status')) &&
                                    input('get.status')==1}selected{/if}>开启</option>
                                <option value="2" {if !empty(input('get.status')) &&
                                    input('get.status')==2}selected{/if}>关闭</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <input name="title" class="layui-input" type="text" placeholder="品牌" />
                        </div>
                    </div>
                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit>搜索</button>
                        <!-- // 打开添加页面 -->
                        <!-- <button class="layui-btn icon-btn" lay-maxmin="true" lay-open="" data-title="添加类目"
                            data-area="60%,80%" data-url="/admin/leimu_edit">添加类目
                        </button> -->
                        <button class="layui-btn icon-btn" lay-maxmin="true" lay-open="" data-title="添加品牌"
                            data-area="60%,80%" data-url="/admin/pinpai_edit">添加品牌
                        </button>
                        <!-- // 删除所有 -->
                        <!-- <button class="layui-btn icon-btn layui-btn-danger" lay-batch="lay-tableList"
                            data-url="/admin/del">
                            <i class="layui-icon layui-icon-delete"></i>删除
                        </button> -->
                    </div>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>
<!-- <script type="text/html" id="tableBar1">
</script> -->
<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a style="color: #1890ff;" class="layui-table-text" lay-open data-title="基础配置" data-area="40%,60%" data-url="/admin/pinpai_edit?id={{d.id}}" >基础配置</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a style="color: green;" class="layui-table-text" lay-open data-title="计划导入配置" data-area="40%,60%" data-url="/admin/pinpai_edit2?id={{d.id}}" >导入配置</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a style="color: rgb(249, 113, 44);" class="layui-table-text" lay-open data-title="计划导入记录" data-area="90%,90%" data-url="/admin/exphonelog?id={{d.id}}" >导入记录</a>
    <!-- <div class="layui-divider layui-divider-vertical"></div> -->
    <!-- <a style="color: green;" class="layui-table-text" lay-open data-title="库复制配置" data-area="40%,60%" data-url="/admin/pinpai_edit3?id={{d.id}}" >库复制配置</a> -->
</script>
{include file="public/nfooter"}
<script>
    layui.use(['admin', 'layer', 'table', 'form'], function () {
        var admin = layui.admin;
        var layer = layui.layer;
        var table = layui.table;        // 表格
        var form = layui.form;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url()}"
            , page: true
            , size: 'lg'
            , where: {
                riderid: "{:input('riderid/d',0)}"
            }
            , toolbar: 'false'
            // , defaultToolbar: ["filter","exports","print"]
            , defaultToolbar: [{
                title: '导出excel' //标题
                , layEvent: 'LAYTABLE_EXPORT' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-export' //图标类名
            }, {
                title: '打印页面' //标题
                , layEvent: 'LAYTABLE_PRINT' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-print' //图标类名
            }, {
                title: '筛选数据' //标题
                , layEvent: 'LAYTABLE_COLS' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-cols' //图标类名
            }]
            , even: true
            , loading: true
            //, limits: [10, 20, 40, 60, 80, 100, 150, 200, 300]
            , limit: 10
            , cols: [[
                // { type: 'checkbox', width: 60 },
                { field: 'id', width: 50, align: 'center', title: 'ID' },
                { field: 'name', toolbar: '#tableBar', width: 300, align: 'center', title: '操作' },
                { field: 'pinpai', width: 120, align: 'center', title: '品牌名称' },
                {
                    field: 'status', align: 'center', title: '开关状态', width: 70, templet: function (d) {
                        var html = '';
                        if (d.status == 1) {
                            html += '<p style="color:green">开启</p>';
                        } else {
                            html += '<p style="color:red">关闭</p>';
                        }
                        return html;
                    }
                },
                { field: 'category_name', align: 'center', title: '所属类目' },
                { field: 'url', align: 'center', title: '飞鱼推送链接', width: 350 },
                { field: 'url2', align: 'center', title: '快手推送链接', width: 350 },
                {
                    field: 'urlm', align: 'center', title: '导入配置', width: 250, templet: function (d) {
                        var html = '';
                        if (d.kags == 1) {
                            html += '<p style="color:green">状态:开启</p>';
                        } else {
                            html += '<p style="color:red">状态:关闭</p>';
                        }
                        if (d.datebefore && d.dateafter) {
                            html += '<p>数据时间范围:' + d.datebefore + '-' + d.dateafter + '天</p>';
                        }
                        html += '<p>日有效:' + d.youxiao + '条|日无效' + d.wuxiao + '条</p>';
                        html += '<p>每条间隔:' + d.times + '分钟</p>';
                        html += '<p>时间:' + d.startime + '点-' + d.endtime + '点</p>';
                        html += '<p>日期:' + d.daterangestar + '日-' + d.daterangeend + '日</p>';
                        if (d.pbpinpai) {
                            html += '<p>屏蔽品牌:' + d.pbpinpai + '</p>';
                        }
                        return html;
                    }
                },

                { field: 'cid', align: 'center', title: 'EC对应cid' },
                { field: 'appId', align: 'center', title: 'EC对应appId' },
                { field: 'appSecret', align: 'center', title: 'EC对应appSecret' },
                { field: 'wzly_name', align: 'center', title: '未知来源默认EC来源' },
            ]]
        })
    })
</script>